package br.com.medvagas.negocio.facade.e;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import br.com.medvagas.comum.entidade.UsuarioProfissional;

@Service
public class PesquisarProfissional implements IPesquisarProfissional {

	@PersistenceContext
	private EntityManager em;
	
	@Transactional(readOnly=true)
	public List<UsuarioProfissional> consultar(UsuarioProfissional usuarioProfissional) {
		TypedQuery<UsuarioProfissional> query = em.createNamedQuery("UsuarioProfissional.consultar", UsuarioProfissional.class);
		return query.getResultList();
	}
	
}
